package cn.com.visual.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import org.springframework.stereotype.Controller;

import cn.com.common.result.DataResult;

import cn.com.gas.entity.GasStationinfoEntity;

import cn.com.gas.service.GasStationinfoService;
import cn.com.gt3.entity.GtFpJxEntity;
import cn.com.gt3.entity.GtFpXxEntity;
import cn.com.gt3.entity.GtRkEntity;
import cn.com.gt3.service.GtFpJxService;
import cn.com.gt3.service.GtFpXxService;
import cn.com.gt3.service.GtRkService;
import cn.com.nr.entity.NrConcreteEndangerEntity;
import cn.com.nr.entity.NrDiggingsEndangerEntity;
import cn.com.nr.entity.NrOfflineCamEntity;
import cn.com.nr.entity.NrRecordsEntity;
import cn.com.nr.service.NrConcreteEndangerService;
import cn.com.nr.service.NrDiggingsEndangerService;
import cn.com.nr.service.NrOfflineCamService;
import cn.com.nr.service.NrRecordsService;
import cn.com.nr.service.NrStationinfoForecastMonthService;
import cn.com.util.TsBqUtils;
import cn.com.visual.vo.req.ReqVO;
import io.swagger.annotations.ApiOperation;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

/**
 * 首页
 *
 * @author shaochangyang
 * @email l2l84o7o5@live.com
 * @date 2024-03-24 01:14:06
 */
@Controller
@RequestMapping("/visual/main")
public class VisualHomeMainController {

	@Autowired
	private NrDiggingsEndangerService nrDiggingsEndangerService;
	@Autowired
	private NrConcreteEndangerService nrConcreteEndangerService;
	@Autowired
	private GasStationinfoService gasStationinfoService;
	@Autowired
	private GtRkService gtRkService;
	@Autowired
	private GtFpJxService gtFpJxService;
	@Autowired
	private GtFpXxService gtFpXxService;
	@Autowired
	private NrRecordsService nrRecordsService;
	@Autowired
	private NrOfflineCamService nrOfflineCamService;
	@Autowired
	private NrStationinfoForecastMonthService nrStationinfoForecastMonthService;
	
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	@ApiOperation(value = "轮播图图片")
	@PostMapping("/carouselImageList")
	@ResponseBody
	public DataResult carouselImageList(@RequestBody ReqVO reqVO) {

		String deptId = reqVO.getDeptId();
		String industry = reqVO.getIndustry();
		List<String> stationinfoIdList = new ArrayList<>();
		
		// 矿山
		LambdaQueryWrapper<NrDiggingsEndangerEntity> queryWrapperNrDiggingsEndanger = Wrappers.lambdaQuery();
		if(TsBqUtils.isNotNull(deptId)){
			queryWrapperNrDiggingsEndanger.eq(NrDiggingsEndangerEntity::getTaxorgcode, deptId);
		}
			
		if(TsBqUtils.isNotNull(industry)){
			queryWrapperNrDiggingsEndanger.eq(NrDiggingsEndangerEntity::getIndustry, industry);

		}
		List<NrDiggingsEndangerEntity> nrDiggingsList = nrDiggingsEndangerService.list(queryWrapperNrDiggingsEndanger);
		for (NrDiggingsEndangerEntity nrDiggingsEndangerEntity : nrDiggingsList) {
			String id = nrDiggingsEndangerEntity.getId();
			stationinfoIdList.add(id);
		}
		
		// 水泥和混凝土
		LambdaQueryWrapper<NrConcreteEndangerEntity> queryWrapperNrConcrete = Wrappers.lambdaQuery();
		
		if(TsBqUtils.isNotNull(deptId)){
			queryWrapperNrConcrete.eq(NrConcreteEndangerEntity::getTaxorgcode, deptId);
		}
		
		if(TsBqUtils.isNotNull(industry)){
			queryWrapperNrConcrete.eq(NrConcreteEndangerEntity::getIndustry, industry);

		}
		List<NrConcreteEndangerEntity> nrConcreteList = nrConcreteEndangerService.list(queryWrapperNrConcrete);
		for (NrConcreteEndangerEntity nrConcreteEndangerEntity : nrConcreteList) {
			String id = nrConcreteEndangerEntity.getId();
			stationinfoIdList.add(id);
		}
		
		Page page = new Page(reqVO.getPage(), reqVO.getLimit());
		
		LambdaQueryWrapper<NrRecordsEntity> queryWrapper = Wrappers.lambdaQuery();
		queryWrapper.like(NrRecordsEntity::getTime, "2025-04");
		if(TsBqUtils.isNotNull(stationinfoIdList)){
			queryWrapper.in(NrRecordsEntity::getNrEndanger, stationinfoIdList);
		}
		
		IPage<NrRecordsEntity> iPage = nrRecordsService.page(page, queryWrapper);
		List<NrRecordsEntity> records = iPage.getRecords();
		for (NrRecordsEntity nrRecordsEntity : records) {
			String nrEndanger = nrRecordsEntity.getNrEndanger();

			GasStationinfoEntity gasStationinfoEntity = gasStationinfoService.getById(nrEndanger);
			String name = gasStationinfoEntity.getName();

			nrRecordsEntity.setNrEndangerName(name);
		}

		return DataResult.success(iPage);
	}

	
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@ApiOperation(value = "预警列表")
	@PostMapping("/warningList")
	@ResponseBody
	public DataResult warningList(@RequestBody NrOfflineCamEntity nrOfflineCam) throws ParseException {
		
		String deptId = nrOfflineCam.getDeptId();
		String industry = nrOfflineCam.getIndustry();
		List<String> stationinfoList = new ArrayList<>();

		if(TsBqUtils.isNotNull(industry)){

			if(industry.equals("混凝土")||industry.equals("水泥制造")){
				LambdaQueryWrapper<NrConcreteEndangerEntity> queryWrapperConcrete = Wrappers.lambdaQuery();
				
				queryWrapperConcrete.eq(NrConcreteEndangerEntity::getIndustry, industry);
				
				List<NrConcreteEndangerEntity> listEntity = nrConcreteEndangerService.list(queryWrapperConcrete);
				
				for (NrConcreteEndangerEntity nrConcreteEndangerEntity : listEntity) {
					stationinfoList.add(nrConcreteEndangerEntity.getId());
				}
				
			}else if(industry.equals("铁矿选矿")||industry.equals("铁矿采矿")){
				LambdaQueryWrapper<NrDiggingsEndangerEntity> queryWrapperDiggings = Wrappers.lambdaQuery();
				
				queryWrapperDiggings.eq(NrDiggingsEndangerEntity::getIndustry, industry);
				
				List<NrDiggingsEndangerEntity> listEntity = nrDiggingsEndangerService.list(queryWrapperDiggings);
				
				for (NrDiggingsEndangerEntity nrDiggingsEndangerEntity : listEntity) {
					stationinfoList.add(nrDiggingsEndangerEntity.getId());
				}
			}
		}
	
		
		
		Page page = new Page(nrOfflineCam.getPage(), nrOfflineCam.getLimit());
		LambdaQueryWrapper<NrOfflineCamEntity> queryWrapper = Wrappers.lambdaQuery();

		queryWrapper.like(NrOfflineCamEntity::getOfflineTime, "2025-04");
		
		if(TsBqUtils.isNotNull(stationinfoList)){
			queryWrapper.in(NrOfflineCamEntity::getStationName, stationinfoList);
		}
		
		if(TsBqUtils.isNotNull(deptId)){
			queryWrapper.in(NrOfflineCamEntity::getTaxorgName, deptId);
		}
		
		IPage<NrOfflineCamEntity> iPage = nrOfflineCamService.page(page, queryWrapper);
		List<NrOfflineCamEntity> records = iPage.getRecords();

		for (NrOfflineCamEntity nrOfflineCamEntity : records) {

			String stationName = nrOfflineCamEntity.getStationName();
			GasStationinfoEntity gasStationinfoEntity = gasStationinfoService.getById(stationName);
			if (TsBqUtils.isNotNull(gasStationinfoEntity)) {
				nrOfflineCamEntity.setStationName(gasStationinfoEntity.getName());
			}
		}
		return DataResult.success(iPage);
	}
	
	
	
	
	@ApiOperation(value = "报税产量和监控产量对比")
	@PostMapping("/yieldComparison")
	@ResponseBody
	public DataResult yieldComparison(@RequestBody ReqVO reqVO) throws ParseException {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

		String industry = reqVO.getIndustry();

		// 默认 2025年 01-04
		String timeStart = reqVO.getTimeStart();
		if (TsBqUtils.isNull(timeStart)) {
			timeStart = "2025-01";
		}

		String timeEnd = reqVO.getTimeEnd();
		if (TsBqUtils.isNotNull(timeEnd)) {
			timeStart = "2025-04";
		}
		
		
		// 监控产量对比
		// 测算吨耗
		// 水泥 35吨 混凝土 12立方 采矿 15吨 选矿 15吨
		LambdaQueryWrapper<NrRecordsEntity> queryWrapper = Wrappers.lambdaQuery();

		queryWrapper.ge(NrRecordsEntity::getTime, sdf.parse(timeStart + "-30 00:00:00"));
		queryWrapper.le(NrRecordsEntity::getTime, sdf.parse(timeEnd + "-30 23:59:59"));

		List<NrRecordsEntity> list = nrRecordsService.list(queryWrapper);

		BigDecimal numForecast = new BigDecimal(0);

		for (NrRecordsEntity nrRecordsEntity : list) {
			String nrEndanger = nrRecordsEntity.getNrEndanger();
			String _industry = "";
			NrDiggingsEndangerEntity diggings = nrDiggingsEndangerService.getById(nrEndanger);
			NrConcreteEndangerEntity concrete = nrConcreteEndangerService.getById(nrEndanger);
			if (TsBqUtils.isNotNull(diggings)) {
				_industry = diggings.getIndustry();
			} else if (TsBqUtils.isNotNull(concrete)) {
				_industry = concrete.getIndustry();
			}

			if (TsBqUtils.isNotNull(_industry)) {
				if (_industry.equals("铁矿选矿")) {
					numForecast.add(new BigDecimal(15));

				} else if (_industry.equals("铁矿采矿")) {
					numForecast.add(new BigDecimal(15));

				} else if (_industry.equals("混凝土")) {
					numForecast.add(new BigDecimal(12));

				} else if (_industry.equals("水泥制造")) {
					numForecast.add(new BigDecimal(35));

				}
			}

		}

		// 报税产量 销售发票

		LambdaQueryWrapper<GtFpXxEntity> queryWrapperFpXx = Wrappers.lambdaQuery();
		queryWrapperFpXx.le(GtFpXxEntity::getKpyf, timeStart);
		queryWrapperFpXx.ge(GtFpXxEntity::getKpyf, timeEnd);
		List<String> listWpmc = new ArrayList<>();
		// 水泥
		listWpmc.add("水泥");
		listWpmc.add("散装水泥");
		listWpmc.add("复合硅酸盐水泥");
		listWpmc.add("散水泥");
		listWpmc.add("42.5普通硅酸盐水泥散装");
		listWpmc.add("加工费");
		listWpmc.add("普通硅酸盐水泥^P·O42.5^散装^盾石");
		listWpmc.add("52.5普通硅酸盐水泥散装");
		listWpmc.add("矿渣硅酸盐水泥");
		listWpmc.add("复合硅酸盐水泥^P·C42.5^散装^盾石");
		listWpmc.add("矿渣硅酸盐水泥^P·S·A32.5^散装^盾石");
		listWpmc.add("普通硅酸盐水泥^P·O42.5R^散装^盾石");
		listWpmc.add("水泥加工费");
		listWpmc.add("52.5R普通硅酸盐水泥散装");
		listWpmc.add("复合硅酸盐水泥42.5散装");
		listWpmc.add("抹灰砂浆");
		listWpmc.add("普通硅酸盐水泥42.5散装");
		listWpmc.add("硅酸盐水泥");
		listWpmc.add("普通硅酸盐水泥^P·O42.5(专供)^散装^盾石");
		listWpmc.add("普通硅酸盐水泥^P-O42.5R(内部专用)^散装^盾石");
		listWpmc.add("普通硅酸盐水泥42.5R散装");
		listWpmc.add("42.5R普通硅酸盐水泥散装");
		listWpmc.add("P.R7.5道路硅酸盐水泥散装");
		listWpmc.add("低碱水泥");
		listWpmc.add("矿渣硅酸盐水泥32.5A型散装");
		// 选矿
		listWpmc.add("铁精粉");
		listWpmc.add("铁粉");
		listWpmc.add("加工费");
		listWpmc.add("矿石加工");
		listWpmc.add("钛精粉");
		listWpmc.add("毛粉");
		listWpmc.add("铁精粉（粗粉）");
		listWpmc.add("铁精粉(干基）");
		listWpmc.add("铁精粉（干基）");
		listWpmc.add("*细石");
		listWpmc.add("PB粉");
		listWpmc.add("河砂");
		listWpmc.add("混碴");
		listWpmc.add("机制砂");
		listWpmc.add("精砂");
		listWpmc.add("卡拉拉精粉");
		listWpmc.add("矿渣");
		listWpmc.add("普通铁粉");
		listWpmc.add("球团");
		listWpmc.add("沙子");
		listWpmc.add("砂子");
		listWpmc.add("湿铁粉");
		listWpmc.add("石碴");
		listWpmc.add("石砟");
		listWpmc.add("水洗机制砂");
		listWpmc.add("水洗砂");
		listWpmc.add("水洗细尾砂");
		listWpmc.add("铁精粉加工费");
		listWpmc.add("铁矿块");
		listWpmc.add("铁矿砂");
		listWpmc.add("铁矿石");
		listWpmc.add("铁选矿粉末");
		listWpmc.add("尾矿砂");
		listWpmc.add("小矿渣");
		listWpmc.add("旋流沙");
		listWpmc.add("渣子");
		// 混凝土
		listWpmc.add("混凝土");
		listWpmc.add("商砼");
		listWpmc.add("混疑土委托加工");
		listWpmc.add("砼冬施（支护专用含减水剂)");
		listWpmc.add("砼冬施（支护专用含减水剂、纤维）");
		// 采矿
		listWpmc.add("铁精粉");
		listWpmc.add("岩士");
		listWpmc.add("碎石");
		listWpmc.add("道砟");
		listWpmc.add("铁矿石");
		listWpmc.add("铁粉");
		listWpmc.add("尾矿砂");
		listWpmc.add("*黑色金属矿石*铁矿石");
		listWpmc.add("石子");
		listWpmc.add("铁选矿粉末");
		listWpmc.add("黑色金属矿石*铁矿石");
		listWpmc.add("黑色金属矿石铁原矿低品位铁矿有");
		listWpmc.add("建筑砂");
		listWpmc.add("矿面");
		listWpmc.add("石磕");

		queryWrapperFpXx.in(GtFpXxEntity::getWpmc, listWpmc);
		List<GtFpXxEntity> listFpXx = gtFpXxService.list(queryWrapperFpXx);

		return DataResult.success();
	}

	@ApiOperation(value = "税收增长率")
	@PostMapping("/taxIncrease")
	@ResponseBody
	public DataResult taxIncrease(@RequestBody ReqVO reqVO) throws ParseException {
		String industry = reqVO.getIndustry();
		String deptId = reqVO.getDeptId();
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

		// 默认 2025年 01-04
		String timeStart = reqVO.getTimeStart();
		if (TsBqUtils.isNull(timeStart)) {
			timeStart = "2025-01";
		}

		String timeEnd = reqVO.getTimeEnd();
		if (TsBqUtils.isNull(timeEnd)) {
			timeEnd = "2025-04";
		}
		String[] timeStartArr = timeStart.split("-");
		int timeStartYear  = Integer.parseInt(timeStartArr[0]);
		int timeStartMonth  = Integer.parseInt(timeStartArr[1]);
		
		String[] timeEndArr = timeEnd.split("-");
		int timeEndYear  = Integer.parseInt(timeEndArr[0]);
		int timeEndMonth  = Integer.parseInt(timeEndArr[1]);
		
		// 同比日期 
		String timeStartWith = "";
		if(timeStartMonth == 1){
			 timeStartWith = (timeStartYear -1) + "-" + 12;
		}else{
			if(timeStartMonth < 10){
				timeStartWith = (timeStartYear -1) + "-0" + (timeStartMonth -1);
			}else{
				timeStartWith = (timeStartYear -1) + "-" + (timeStartMonth -1);
			}
		}
		
		String timeEndWith = "";
		if(timeEndMonth == 1){
			 timeEndWith = (timeEndYear -1) + "-" + 12;
		}else{
			if(timeStartMonth < 10){
				timeEndWith = timeEndYear + "-0" + (timeEndMonth -1);
			}else{
				timeEndWith = timeEndYear + "-" + (timeEndMonth -1);
			}
		}
		
		// 环比日期
		String timeStartRing = (timeStartYear -1) + "-" + timeStartArr[1];
		String timeEndRing = (timeEndYear -1) + "-" + timeEndArr[1];

		// 正常计算
		LambdaQueryWrapper<GtRkEntity> queryWrapper = Wrappers.lambdaQuery();
		queryWrapper.ge(GtRkEntity::getRq, timeStart.replace("-", ""));
		queryWrapper.le(GtRkEntity::getRq, timeEnd.replace("-", ""));
		if(TsBqUtils.isNotNull(industry)&&!industry.equals("请选择行业")){
			queryWrapper.eq(GtRkEntity::getHy, industry);
		}
		
		List<GtRkEntity> list = gtRkService.list(queryWrapper);
		double sum = list.stream().mapToDouble(GtRkEntity::getRkhj).sum(); // 计算总和

		// 计算同比
		LambdaQueryWrapper<GtRkEntity> queryWrapperWith = Wrappers.lambdaQuery();
		queryWrapperWith.ge(GtRkEntity::getRq, timeStartWith.replace("-", ""));
		queryWrapperWith.le(GtRkEntity::getRq, timeEndWith.replace("-", ""));
		if(TsBqUtils.isNotNull(industry)&&!industry.equals("请选择行业")){
			queryWrapperWith.eq(GtRkEntity::getHy, industry);
		}
		
		List<GtRkEntity> listWith = gtRkService.list(queryWrapperWith);
		double sumWith = listWith.stream().mapToDouble(GtRkEntity::getRkhj).sum(); // 计算总和

		// 计算环比
		LambdaQueryWrapper<GtRkEntity> queryWrapperRing = Wrappers.lambdaQuery();
		queryWrapperRing.ge(GtRkEntity::getRq, timeStartRing.replace("-", ""));
		queryWrapperRing.le(GtRkEntity::getRq, timeEndRing.replace("-", ""));
		if(TsBqUtils.isNotNull(industry)&&!industry.equals("请选择行业")){
			queryWrapperRing.eq(GtRkEntity::getHy, industry);
		}
		
		List<GtRkEntity> listRing = gtRkService.list(queryWrapperRing);
		double sumRing = listRing.stream().mapToDouble(GtRkEntity::getRkhj).sum(); // 计算总和

		BigDecimal decimal = new BigDecimal(sum);
		BigDecimal decimalWith = new BigDecimal(sumWith);
		BigDecimal decimalRing = new BigDecimal(sumRing);

		// 同比增长
		BigDecimal with = decimal.subtract(decimalWith);
		// 同比增长率
		BigDecimal withL = (with.divide(decimal, 2, RoundingMode.HALF_UP)).multiply(new BigDecimal(100));
		// 环比增长
		BigDecimal ring = decimal.subtract(decimalRing);
		// 环比增长率
		BigDecimal ringL = ring.divide(decimal, 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
		
		List<String> resultList = new ArrayList<String>();
		String _with = (with.setScale(0, RoundingMode.DOWN) + "").replace("-", "");
		String _withL = (withL.setScale(0, RoundingMode.DOWN) + "").replace("-", "");
		String _ring = (ring.setScale(0, RoundingMode.DOWN) + "").replace("-", "");
		String _ringL = (ringL.setScale(0, RoundingMode.DOWN) + "").replace("-", "");
		
		BigDecimal divide = decimal.divide(new BigDecimal(10000), 0, RoundingMode.HALF_UP);
		
		resultList.add(_with);
		resultList.add(_withL);
		resultList.add(_ring);
		resultList.add(_ringL);
		resultList.add(divide + "");
		
		return DataResult.success(resultList);
	}

	@ApiOperation(value = "测算吨耗与实际吨电对比")
	@PostMapping("/tonComparison")
	@ResponseBody
	public DataResult tonComparison(@RequestBody ReqVO reqVO) throws ParseException {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String industry = reqVO.getIndustry();
		// 默认 2025年 01-04
		String timeStart = reqVO.getTimeStart();
		if (TsBqUtils.isNull(timeStart)) {
			timeStart = "2025-01";
		}

		String timeEnd = reqVO.getTimeEnd();
		if (TsBqUtils.isNotNull(timeEnd)) {
			timeStart = "2025-04";
		}

		// 测算吨耗
		// 水泥 35吨 混凝土 12立方 采矿 15吨 选矿 15吨
		LambdaQueryWrapper<NrRecordsEntity> queryWrapper = Wrappers.lambdaQuery();

		queryWrapper.ge(NrRecordsEntity::getTime, sdf.parse(timeStart + "-30 00:00:00"));
		queryWrapper.le(NrRecordsEntity::getTime, sdf.parse(timeEnd + "-30 23:59:59"));

		List<NrRecordsEntity> list = nrRecordsService.list(queryWrapper);

		BigDecimal numForecast = new BigDecimal(0);

		for (NrRecordsEntity nrRecordsEntity : list) {
			String nrEndanger = nrRecordsEntity.getNrEndanger();
			String _industry = "";
			NrDiggingsEndangerEntity diggings = nrDiggingsEndangerService.getById(nrEndanger);
			NrConcreteEndangerEntity concrete = nrConcreteEndangerService.getById(nrEndanger);
			if (TsBqUtils.isNotNull(diggings)) {
				_industry = diggings.getIndustry();
			} else if (TsBqUtils.isNotNull(concrete)) {
				_industry = concrete.getIndustry();
			}

			if (TsBqUtils.isNotNull(_industry)) {
				if (_industry.equals("铁矿选矿")) {
					numForecast.add(new BigDecimal(15));

				} else if (_industry.equals("铁矿采矿")) {
					numForecast.add(new BigDecimal(15));

				} else if (_industry.equals("混凝土")) {
					numForecast.add(new BigDecimal(12));

				} else if (_industry.equals("水泥制造")) {
					numForecast.add(new BigDecimal(35));

				}
			}

		}
		
		
		/*QueryWrapper<NrStationinfoForecastMonthEntity> queryWrapper = new QueryWrapper<>();
		LambdaQueryWrapper<NrStationinfoForecastMonthEntity> lambdaQueryWrapper = queryWrapper.select("count(1) AS value,ywlb as name").lambda().groupBy(NrStationinfoForecastMonthEntity::getTime);
		lambdaQueryWrapper.isNotNull(NrStationinfoForecastMonthEntity::getTime);
		
		
		List<TsSqBsAnnex1Entity> list = tsSqBsAnnex1Service.list(lambdaQueryWrapper);
		
		*/
		
		
		// 测试电力 110010102020
		LambdaQueryWrapper<GtFpJxEntity> queryWrapperReal = Wrappers.lambdaQuery();
		queryWrapperReal.ge(GtFpJxEntity::getKpyf, timeStart);
		queryWrapperReal.le(GtFpJxEntity::getKpyf, timeEnd);
		queryWrapperReal.like(GtFpJxEntity::getSpbm, "110010102020");

		List<GtFpJxEntity> list2 = gtFpJxService.list(queryWrapperReal);
		BigDecimal numReal = new BigDecimal(0);
		for (GtFpJxEntity gtFpJxEntity : list2) {
			String sl = gtFpJxEntity.getSl();
			numReal.add(new BigDecimal(sl));
		}

		return DataResult.success();
	}

	private static String handleMonthYear(int month, int year) {
		if (month <= 9) {
			return year + "0" + month;
		} else {
			return year + "" + month;
		}
	}

}
